#define  _CRT_SECURE_NO_WARNINGS 1

#include "Sort.h"

void TestMerge()
{
	int n = 50;
	int* arr = (int*)malloc(sizeof(int) * n);
	if (arr == NULL)
	{
		perror("malloc fail");
		exit(-1);
	}
	for (int i = 0; i < n; ++i)
	{
		arr[i] = rand() % 101;
	}

	PrintArray(arr, n);
	MergeSort(arr, n);
	PrintArray(arr, n);

}

	
void TestMergeNonR()
{
	int n = 50;
	int* arr = (int*)malloc(sizeof(int) * n);
	if (arr == NULL)
	{
		perror("malloc fail");
		exit(-1);
	}
	for (int i = 0; i < n; ++i)
	{
		arr[i] = rand() % 101;
	}

	PrintArray(arr, n);
	MergeSortNonR(arr, n);
	PrintArray(arr, n);
}

int main()
{
	srand((unsigned int)time(NULL));
	//TestMerge();
	TestMergeNonR();

	return 0;
}